home *** CD-ROM | disk | FTP | other *** search
- Path: user2.mnsinc.com!huang
- From: huang@mnsinc.com (Szu-Wen Huang)
- Newsgroups: comp.lang.c
- Subject: Re: big endian, little endian
- Date: 18 Apr 1996 17:39:13 GMT
- Organization: Monumental Network Systems
- Message-ID: <4l5uo1$79p@news1.mnsinc.com>
- References: <4ku9dm$t1t@news.ycc.yale.edu> <3172C1E9.3E95@willows.com> <4l5n36$qk8@hsun27.chevron.com>
- NNTP-Posting-Host: user.mnsinc.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- C.W.Racer (gacwra@hsun13.hou281.chevron.com) wrote:
- : In article <3172C1E9.3E95@willows.com>, Tarang Deshpande <tarang@willows.com> writes:
- : |> Actually it has nothing to with signed/unsigned integer rather it has to
- : |> do with how integers are represented in memory on different platforms.
- : |> In the representation of a two byte integer the question becomes is the
- : |> high byte or the low byte at the lower or higher address. If the
- : |> low byte is at the lower address then it uses little endian whereas if
- : |> the high byte is at the lower address then it used big endian.
-
- : |> So the number 256 which is 0000000100000000 in binary can be thought off
- : |> as 00000001 * 256 + 00000000 where the 00000001 is the high byte and
- : |> 00000000 is the low byte. On a little endian platform memory would look
- : |> like 0000000000000001 whereas on a big endian platform memory would look
- : |> like 0000000100000000.
-
- : Actually the representation is the same, only the byte numbering is
- : different.
-
- No, the difference between little/big endian byte ordering is as Tarang
- described, a matter of whether more significant digits are stored in
- higher memory (little endian) or the reverse. This is not "byte
- numbering", whatever that is ;). Representation is another thing
- altogether. That would refer to how a number or an English letter or
- anything else is mapped to binary numbers.
-